(*****************************************************************************
 * Delphi Plug-in Framework (DPF)
 * Copyright (C) 2006-2007 Tao Yuan
 *
 * The contents of this file are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the
 * License at http://www.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.                                                               }
 *
 * The Initial Developer of the Original Code is Tao Yuan. Portions created by
 * Tao Yuan are Copyright (C) Tao Yuan (taoy.cn att gmail dott com)
 * All rights reserved.
 *****************************************************************************)
unit Ril;

interface

uses
  Windows, TypInfo, Classes;

type
  TRILHandle = Pointer;

  IComponent = interface;

  TGetChildCallback = procedure (Param: Pointer; Component: IComponent;
      var Result: Boolean) of object;

  { The IComponent is the base interface for a component living
    on a form/data module.  Never hold this interface for very long, since
    the component may be deleted at any time. }

  IComponent = interface(IInterface)
  ['{D991CBDB-B267-45A6-B167-CDA8101BAF04}']
    function GetComponentHandle: TRILHandle;
  end;

  IControl = interface(IComponent)
  ['{F13F82D1-93F0-4481-A552-57544EB5939A}']
    function GetHeight: Integer; 
    function GetLeft: Integer;
    function GetTop: Integer;
    function GetVisible: Boolean;
    function GetWidth: Integer;
    procedure SetHeight(const Value: Integer);
    procedure SetLeft(const Value: Integer);
    procedure SetTop(const Value: Integer);
    procedure SetVisible(const Value: Boolean);
    procedure SetWidth(const Value: Integer);
    procedure Show;
    property Height: Integer read GetHeight write SetHeight;
    property Left: Integer read GetLeft write SetLeft;
    property Top: Integer read GetTop write SetTop;
    property Visible: Boolean read GetVisible write SetVisible;
    property Width: Integer read GetWidth write SetWidth;
  end;

  IWinControl = interface(IControl)
  ['{41FFEFAD-5E2F-4BD2-9A0B-D247780F366A}']
    function GetHandle: HWnd;
    function GetParentWindow: HWnd;
    procedure SetParentWindow(const Value: HWnd);
    property Handle: HWnd read GetHandle;
    property ParentWindow: HWnd read GetParentWindow write SetParentWindow;
  end;

  IStream = interface(IInterface)
  ['{CAB7117A-B0F5-48DA-AD58-0FDFB8C32889}']
    function GetSize: LongWord;
    function Read(var Buffer; Count: LongWord): LongWord;
    function Write(const Buffer; Count: LongWord): LongWord;
    function GetPosition: Int64;
    procedure SetPosition(const Value: Int64);
    property Position: Int64 read GetPosition write SetPosition;
    property Size: LongWord read GetSize; 
    procedure Clear;
    procedure LoadFromFile(AFileName: string);
    procedure SaveToFile(AFileName: string);

  end;



implementation

end.
